package cn.edu.zjut.mina.util;

import java.util.concurrent.ConcurrentHashMap;

import cn.edu.zjut.mina.bean.RoomInfo;
import cn.edu.zjut.mina.interf.IRoomInfo;

/**
 * 绑定房间号与房间中用户的类
 * @author 张宇翔
 */
public class UserSessionMap extends ConcurrentHashMap<String, IRoomInfo> {
	
	private static final long serialVersionUID = 1L;
	
	private static UserSessionMap sessionMap;

    private static final class Single {
        private static final UserSessionMap SESSION_MAP = new UserSessionMap();
    }

    private UserSessionMap() {
        super(500);//set max size for queue
    }

    public static UserSessionMap getInstance() {
        if (sessionMap == null)
            sessionMap = Single.SESSION_MAP;
        return sessionMap;
    }
}
